package cn.tedu.controller;


import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.tedu.entity.ProjectCase;
import cn.tedu.service.ProjectCaseService;
import cn.tedu.service.impl.ProjectCaseServiceImpl;
/**
 * 项目案例
 * @author waqwb
 *
 */
public class ProjectCaseServlet extends HttpServlet {
	@Override
	protected void service(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		System.out.println("CaseServlet");
		resp.setContentType("text/html;charset=utf-8");
		String uri = req.getRequestURI().split("\\.")[0];
		System.out.println(uri);
		ProjectCaseService pcs = new ProjectCaseServiceImpl();
		/**
		 * 项目案例
		 */
		List<ProjectCase> caseList = pcs.caseList();
		System.out.println(caseList.toString());
		req.setAttribute("caseList", caseList);
		/**
		 * 软件项目
		 */
		List<ProjectCase> softList = pcs.softList();
		System.out.println(softList.toString());
		req.setAttribute("softList", softList);
		/**
		 * 制造行业案例
		 */
		List<ProjectCase> proList = pcs.proList();
		System.out.println(proList.toString());
		req.setAttribute("proList", proList);
		req.getRequestDispatcher("xiangmu.jsp").forward(req, resp);
	}
}
